{%extends "base.xhtml"%}
{% load i18n %}
{% load ham %}
{%block content%}
	<script language="JavaScript" src="/files/select.js"></script>
	<h2>{%trans "Add goal"%}</h2>
	{% if form.has_errors %}
	{%trans "Correct following errors"%}
	{%endif%}

	<form method="post" action="{%href ""%}">
	<p>
		<label for="id_resultsTime">{%trans "When goal results should be published"%}</label>
		{{ form.resultsTime }}
        	{% if form.resultsTime.errors %}*** {{ form.resultsTime.errors|join:", " }}{% endif %}
	</p>
	<p>
		<label for="id_maxPoints">{%trans "Maximum points for goal"%}</label>
		{{ form.maxPoints }}
        	{% if form.maxPoints.errors %}*** {{ form.maxPoints.errors|join:", " }}{% endif %}
	</p>
	<p>
		<label for="id_scoringWay">{%trans "Scoring way"%}</label>
		{{ form.scoringWay }}
        	{% if form.scoringWay.errors %}*** {{ form.scoringWay.errors|join:", " }}{% endif %}
	</p>
	<p>
		<label for="id_tests">{%trans "Tests"%}</label>
		{{ form.tests }}
        	{% if form.tests.errors %}*** {{ form.tests.errors|join:", " }}{% endif %}
	</p>
		<div id="target" class="leftHamSelect"></div>
		<div id="source" class="rightHamSelect">{%trans "Loading list"%}</div>
	<input type="submit" value="{%trans "Add goal"%}"/>
	</form>
	<script>
	ham_go(window.document.getElementById("source"),"{%href "pacs.ajax.list_tests" problem_id=problem.id%}");
	ham_connect("source","target","id_tests","{%trans "Unselect"%}");
	</script>
{%endblock%}

